// 引入
const express = require('express');
const favicon = require('serve-favicon');
const session = require('express-session');
const redactRouter_WH = require('./router/zuZhiGuanLi——wangHeng/redactRouter_WH');
const newRouter_WH = require('./router/zuZhiGuanLi——wangHeng/newRouter_WH');
const delRouter_WH = require('./router/zuZhiGuanLi——wangHeng/delRouter_WH');
const showRouter_WH = require('./router/zuZhiGuanLi——wangHeng/showRouter_WH');
const sortRouter_WH = require('./router/zuZhiGuanLi——wangHeng/sortRouter_WH');
const editRouter_QR = require('./router/xinChouFuLi1--QinRong/editRouter_QR');
const sheBaoRouter_OR=require('./router/xinChouFuLi1--QinRong/sheBaoRouter_OR');
const between_QR=require('./router/xinChouFuLi1--QinRong/xinchouguanxi_QR');
const login = require('./router/sider/login');
const bianxieRouter_SJY = require('./router/zhaoPinGuanLi--SongJiaYu/bianxieRouter_SJY');
const jianliRouter_SJY = require('./router/zhaoPinGuanLi--songJiaYu/jianliRouter_SJY');
const salary_HYH = require('./router/xinchouGuanLi--HYH/salary_HYH');
const level_HYH=require('./router/xinchouGuanLi--HYH/level_HYH');
const baogao = require('./router/xitongshouye/baogao');
const riqi = require('./router/xitongshouye/riqi');
const gonggao = require('./router/xitongshouye/gonggao');
const redactRouter = require('./router/kaoQinGuanLi--JangPeng/redactRouter--JP');

const renshi = require('./router/renshiguanli/renshiguanli');
// 创建服务


// 创建服务
const serve = express();

// 配置服务
serve.use(express.static(__dirname + "/public"));
serve.use(session({
        name: 'demo',
        secret: 'web281',
        cookie: {
            maxAge: 1000 * 60 * 10
        },
        rolling: true,
        resave: true
    }))
    // serve.use(favicon(__dirname + "public/"));

// 配置请求的post数据
serve.use(express.json());
serve.use(express.urlencoded({ extended: true }));

// 使用路由
serve.use(redactRouter_WH);
serve.use(showRouter_WH);
serve.use(newRouter_WH);
serve.use(delRouter_WH);
serve.use(sortRouter_WH);
serve.use(editRouter_QR);
serve.use(sheBaoRouter_OR);
serve.use(between_QR)
serve.use(login);
serve.use(bianxieRouter_SJY);
serve.use(jianliRouter_SJY);
serve.use(salary_HYH);
serve.use(level_HYH);
serve.use(baogao);
serve.use(riqi);
serve.use(renshi);
serve.use(gonggao);
serve.use(redactRouter);

// 端口号
serve.listen(8099, () => {
    console.log("已启动");
});